package com.wf.ew.common;

import net.sf.json.JSONObject;
import org.apache.poi.ss.formula.functions.T;


/**
 * @author: Damon
 * @date: Sep 11, 2014 10:17:40 PM
 * @version : 1
 */

public class ServiceSupport {

	/**
	 * <p>
	 * 转换为 layui-table 需要的分页格式 JSON
	 * </p>
	 *
	 * @param page 分页对象
	 * @return
	 */
	public String jsonPage(PageResult<T> page) {
		JSONObject data = new JSONObject();
		data.put("count", page.getCount());
		data.put("data", page.getData());
		data.put("msg", "查询成功");
		data.put("code", 0);
		System.out.println(data.toString());
		return data.toString();
	}
	
}
